﻿CREATE VIEW [dbo].[vDangKyKd]
AS 
	SELECT     dbo.tblDangKyKD.Stt_Rec, dbo.tblDmPx.Ma_Px, dbo.tblDmPx.Ten_Px, dbo.tblDangKyKD.So_Bn, dbo.tblDangKyKD.Ma_Hs, dbo.tblDangKyKD.So_Gp, 
                      dbo.tblDangKyKD.Ngay_Nop, dbo.tblDangKyKD.Ten_HoKd, dbo.tblHoSoCn.Ho_Ten, dbo.tblDangKyKD.Ngay_Cap, dbo.tblDangKyKD.Ngay_Tra, 
                      dbo.tblDangKyKD.Dia_Diem, dbo.tblDangKyKD.Noi_dung, dbo.tblDangKyKD.Dt_Kd, dbo.tblDangKyKD.DienThoai_Kd, dbo.tblDangKyKD.Fax_Kd, 
                      dbo.tblDangKyKD.Email_Kd, dbo.tblDangKyKD.Website_Kd, dbo.tblDmTt.Ma_Tt , dbo.tblDmTt.Ten_Tt,ISNULL(tblDangKyKD.Da_Tra,0) Da_Tra
FROM         dbo.tblHoSoCn INNER JOIN
                      dbo.tblDangKyKD ON dbo.tblHoSoCn.Ma_HsCn = dbo.tblDangKyKD.Ma_HsCn INNER JOIN
                      dbo.tblDmPx ON dbo.tblDangKyKD.Ma_Px = dbo.tblDmPx.Ma_Px INNER JOIN
                      dbo.tblDmTt ON dbo.tblDangKyKD.Ma_Tt = dbo.tblDmTt.Ma_Tt;